<div>
<!-- 面包屑导航 -->
<el-breadcrumb separator-class="el-icon-arrow-right" class='breadlink'>
  <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
  <el-breadcrumb-item>用户管理</el-breadcrumb-item>
  <el-breadcrumb-item>用户列表</el-breadcrumb-item>
</el-breadcrumb>
<!-- 表格 -->
<el-table
:data="rolesList"
style="width: 100%">
<!-- 展开行 -->
<el-table-column type="expand">
  <template slot-scope="scope">
    <el-row v-for='level1 in scope.row.children' :key='level1.id' class="level1">
      <el-col :span="4">
        <el-tag type="primary" closable>{{level1.authName}}</el-tag>
      </el-col>
      <el-col :span="20">
        <el-row v-for='level2 in level1.children' :key='level2.id' class="level2">
          <el-col :span="4">
            <el-tag type="success" closable>{{level2.authName}}</el-tag>
          </el-col>
          <el-col :span="20">
            <el-tag class="level3" v-for='level3 in level2.children' :key='level3.id' type="warning" closable>{{level3.authName}}</el-tag>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
  </template>
</el-table-column>

<!-- 索引 -->
<el-table-column
    type="index">
</el-table-column>

<el-table-column
  prop="roleName"
  label="角色名称"
  width="180">
</el-table-column>
<el-table-column
  prop="roleDesc"
  label="描述"
  width="180">
</el-table-column>
<el-table-column
  label="操作">
  <template slot-scope="scope">
    <el-button size='mini' plain type="primary" icon="el-icon-edit"></el-button>
    <el-button size='mini' plain type="danger" icon="el-icon-delete"></el-button>
    <el-button size='mini' plain type="success" icon="el-icon-check" @click='showAssignRight(scope.row)'>分配权限</el-button>
  </template>
</el-table-column>
</el-table>
<!-- 打开分配权限对话框 -->
<el-dialog title="角色授权" :visible.sync="isShowAssignRight">
    <el-tree
    ref='tree'
    :default-expand-all='true'
      :data="assignRightsList"
      show-checkbox
      node-key="id"
      :default-expanded-keys="[1,2, 3]"
      :default-checked-keys="[5]"
      :props="defaultProps">
    </el-tree>
    <div slot="footer" class="dialog-footer">
      <el-button @click="isShowAssignRight = false">取 消</el-button>
      <el-button type="primary" @click="assignRights">分 配</el-button>
    </div>
  </el-dialog>
</div>
